The lumbosacral trunk is formed by the ventral rami of L4 and L5.  The descending part of the ventral ramus of L4 emerges from the medial border of the psoas major muscle, medial to the obturator nerve and behind the common iliac vessels.  The nerve descends into the true pelvis, to join the ventral ramus of L5, to form the lumbosacral trunk.  This descends over the pelvic brim anterior to the sacro-iliac joint to join the ventral ramus of S1.